package com.zpp.gobang.service;

import com.zpp.gobang.mapper.UserMapper;
import com.zpp.gobang.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public User queryByUsername(String username){
        return userMapper.selectByUsername(username);
    }

    public int registerUser(User user){
        return userMapper.insertUser(user);
    }

    public void winUSer(int userId){
        userMapper.winUser(userId);
    }

    public void loseUser(int userId){
        userMapper.loseUser(userId);
    }
}
